﻿using System;
using System.Collections.Generic;

namespace Meqs.Entity
{
    /// <summary>
    /// 系统权限
    /// </summary>
    [Serializable]
    public class SysRole
    {
        public SysRole(int mRid, string mRoleName, string mPermission, string mShoolMark)
        {
            m_RID = mRid;
            m_RoleName = mRoleName;
            m_Permission = mPermission;
            m_ShoolMark = mShoolMark;
        }

        public SysRole()
        {
            m_RID = 0;

        }

        #region RID

        private int m_RID;

        public int RID
        {
            get { return m_RID; }
            set { m_RID = value; }
        }

        #endregion

        #region RoleName

        private string m_RoleName;

        public string RoleName
        {
            get { return m_RoleName; }
            set { m_RoleName = value; }
        }

        #endregion

        #region Permission

        private string m_Permission;

        public string Permission
        {
            get { return m_Permission; }
            set { m_Permission = value; }
        }

        #endregion

        #region SchoolMark

        private string m_ShoolMark;

        public string SchoolMark
        {
            get { return m_ShoolMark; }
            set { m_ShoolMark = value; }
        }

        #endregion



        #region Rewrite Equals and HashCode

        /// <summary>
        /// 
        /// </summary>
        public override bool Equals(object obj)
        {
            if (this == obj) return true;
            if ((obj == null) || (obj.GetType() != GetType())) return false;
            SysRole castObj = (SysRole)obj;
            return (castObj != null)
 && m_RID == castObj.RID;
        }

        /// <summary>
        /// 用唯一值实现GetHashCode
        /// </summary>
        public override int GetHashCode()
        {
            int hash = 38;
            hash = hash * 38
 * m_RID.GetHashCode(); return hash;
        }

        #endregion


    }
}